﻿using VisualWip.Core.Interfaces;

namespace VisualWip.Core.Columns
{
    public class WorkInProgressGroupColumn : WorkDualQueryColumnBase
    {
        private readonly NoQuery _noQuery = new NoQuery();
        private int _workInProgress;

        public WorkInProgressGroupColumn(IWorkItemProviderFactory workItemProviderFactory) : base(workItemProviderFactory)
        {
        }

        public override IQuery Query
        {
            get { return _noQuery; }
        }

        public override int WorkInProgress
        {
            get { return _workInProgress; }
        }

        public override void DoRefresh()
        {
            _workInProgress = FirstColumnWorkCount() + SecondColumnWorkCount();
            OnPropertyChanged(this, () => WorkInProgress);
        }

        public override int GetWorkInProgressLimit()
        {
            return TotalWorkInProgressLimit;
        }
    }
}